package com.lanqiao.attendance.utils;


import com.lanqiao.attendance.pojo.User;

/**
 * @program: shop
 * @description
 * @author: 刘 华
 * @create: 2022-06-29 11:34
 **/

public class UserThreadLocal {

    private UserThreadLocal(){}
    //线程变量隔离
    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();

    public static void put(User user){
        LOCAL.set(user);
    }

    public static User get(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}
